﻿namespace TestApp.DataService.Host
{
    using System;
    using System.ServiceModel;
    using Contracts;
    using Microsoft.Practices.Unity;

    public class Program
    {
        public static void Main(string[] args)
        {
            var container = new UnityContainer();
            using (container)
            {
                container.AddNewExtension<DataServiceUnityContainerExtension>();
                var baseAddress = new Uri("net.tcp://localhost:8000/");
                using (var host = new ServiceHost(container.Resolve<IDataService>(), baseAddress))
                {
                    host.Open();
                    Console.WriteLine("Press any key to exit");
                    Console.ReadLine();
                }
            }
        }
    }
}
